HA$PBExportHeader$w_main2.srw
forward
global type w_main2 from window
end type
type mdi_1 from mdiclient within w_main2
end type
type uo_toolbarstrip from u_cst_toolbarstrip within w_main2
end type
type uo_xplistbar from u_cst_xplistbar within w_main2
end type
type uo_powerdock from u_cst_powerdock within w_main2
end type
type ddlb_theme from dropdownlistbox within w_main2
end type
end forward

global type w_main2 from window
boolean visible = false
integer width = 2194
integer height = 1208
boolean titlebar = true
string title = "PowerDock Sample"
string menuname = "m_main"
boolean controlmenu = true
boolean minbox = true
boolean maxbox = true
boolean resizable = true
windowtype windowtype = mdihelp!
windowstate windowstate = maximized!
long backcolor = 67108864
string icon = "AppIcon!"
boolean center = true
event hide pbm_hidewindow
mdi_1 mdi_1
uo_toolbarstrip uo_toolbarstrip
uo_xplistbar uo_xplistbar
uo_powerdock uo_powerdock
ddlb_theme ddlb_theme
end type
global w_main2 w_main2

type variables
u_cst_test1 iuo_1
u_cst_test2 iuo_2
u_cst_test3 iuo_3
u_cst_test4 iuo_4
u_cst_test5 iuo_5
u_cst_test6 iuo_6
u_cst_test7 iuo_7
u_cst_test8 iuo_8

u_cst_mle uo_mle1
u_cst_mle uo_mle2
u_cst_mle uo_mle3
u_cst_mle uo_mle4
u_cst_mle uo_mle5

w_tabtest iw_windowtest
w_tabtest iw_windowtest2
end variables

event resize;uo_toolbarstrip.Width = THIS.WorkSpaceWidth() - 12
uo_PowerDock.Resize(THIS.WorkSpaceWidth() - 8,THIS.WorkSpaceHeight() - MDI_1.MicroHelpHeight	- uo_toolbarstrip.Height - 10)
end event

on w_main2.create
if this.MenuName = "m_main" then this.MenuID = create m_main
this.mdi_1=create mdi_1
this.uo_toolbarstrip=create uo_toolbarstrip
this.uo_xplistbar=create uo_xplistbar
this.uo_powerdock=create uo_powerdock
this.ddlb_theme=create ddlb_theme
this.Control[]={this.mdi_1,&
this.uo_toolbarstrip,&
this.uo_xplistbar,&
this.uo_powerdock,&
this.ddlb_theme}
end on

on w_main2.destroy
if IsValid(MenuID) then destroy(MenuID)
destroy(this.mdi_1)
destroy(this.uo_toolbarstrip)
destroy(this.uo_xplistbar)
destroy(this.uo_powerdock)
destroy(this.ddlb_theme)
end on

event open;uo_PowerDock.of_SetMenu(m_main.m_window)

//Open some documents (i.e. windows)
uo_PowerDock.of_OpenDocument(iuo_5, 'About','Help!')
uo_PowerDock.of_OpenDocument(iuo_8, 'GroupBox','GroupBox!')
uo_PowerDock.of_OpenDocument(iuo_6, 'Tab Control','Tab!')
uo_PowerDock.of_OpenDocument(iuo_3, 'Shortcutbar','ListBox!')
uo_PowerDock.of_OpenDocument(iuo_1, 'Toolbarstrip','SQL!')
uo_PowerDock.of_OpenDocument(iuo_4, 'Buttonlistbar','ArrangeIcons!')
uo_PowerDock.of_OpenDocument(iuo_2, 'Statictext','StaticText!')
uo_PowerDock.of_OpenDocument(iuo_7, 'XPListBar','TreeView!')
uo_PowerDock.of_OpenDocument(iw_windowtest, 'Window','Window!')
uo_PowerDock.of_OpenDocument(iw_windowtest2, 'Window','Window!')

//Activate a document
uo_PowerDock.of_ActivateDocument(iuo_5)

//Add items to the dock windows
uo_PowerDock.of_AddDockItem(uo_PowerDock.RIGHT, uo_mle1, "Right", 'ListBox!')
//uo_PowerDock.of_AddDockItem(uo_PowerDock.LEFT, uo_xplistbar, "XPListBar", 'TreeView!')
//uo_PowerDock.of_AddDockItem(uo_PowerDock.LEFT, uo_mle2, "LEFT", 'ListBox!')
//uo_PowerDock.of_AddDockItem(uo_PowerDock.BOTTOM, uo_mle3, "Output", 'ListBox!')
//uo_PowerDock.of_AddDockItem(uo_PowerDock.BOTTOM, uo_mle4, "Errors", 'ListBox!')
//uo_PowerDock.of_AddDockItem(uo_PowerDock.TOP, uo_mle5, "Top", 'ListBox!')

//Set focus to specific dock items
uo_PowerDock.of_SetDockItemFocus(uo_xplistbar)

//Auto dock the left dock window
//uo_PowerDock.of_SetDock(uo_PowerDock.LEFT, TRUE)

//Set some initial sizes
uo_PowerDock.of_SetDockSize(uo_PowerDock.LEFT, 875)
//uo_PowerDock.of_SetDockSize(uo_PowerDock.RIGHT, 875)
//uo_PowerDock.of_SetDockSize(uo_PowerDock.TOP, 500)
//uo_PowerDock.of_SetDockSize(uo_PowerDock.BOTTOM, 500)



//************************************************************
//		INITIALIZATION CODE FOR THE OTHER CONTROLS
//************************************************************
//Toolbar Strip
uo_toolbarstrip.of_AddItem('Open', 'Open!')
uo_toolbarstrip.of_AddItem('Save', 'Save!')
uo_toolbarstrip.of_AddSeparator()
uo_toolbarstrip.of_AddItem('Print', 'Print!')
uo_toolbarstrip.of_AddItem('Preview', 'Preview!')
uo_toolbarstrip.of_AddSeparator()
uo_toolbarstrip.of_AddItem('Cut','Cut!')
uo_toolbarstrip.of_AddItem('Copy','Copy!')
uo_toolbarstrip.of_AddItem('Paste','Paste!')
uo_toolbarstrip.of_AddSeparator()
uo_toolbarstrip.of_AddObject('Themes', ddlb_theme)

CHOOSE CASE uo_toolbarstrip.il_CurrentTheme
	CASE uo_toolbarstrip.BLUE
		ddlb_theme.SelectItem(1)
		ddlb_theme.Event SelectionChanged(1)
	CASE uo_toolbarstrip.SILVER
		ddlb_theme.SelectItem(2)
		ddlb_theme.Event SelectionChanged(2)
	CASE uo_toolbarstrip.OLIVE
		ddlb_theme.SelectItem(3)
		ddlb_theme.Event SelectionChanged(3)
	CASE ELSE
		ddlb_theme.SelectItem(4)
		ddlb_theme.Event SelectionChanged(4)
END CHOOSE

uo_toolbarstrip.of_AddItem('Exit', 'Exit!', 'Close Winodw', uo_toolbarstrip.RIGHT)



//XPListBar
Long ll_parent

ll_parent = uo_xplistbar.of_AddGroup('General', 'Mail.ico', uo_xplistbar.SPECIAL)
uo_xplistbar.of_AddLink('Display Image in Header', 'Custom001!', ll_parent)
uo_xplistbar.of_AddLink('Hide Image in Header', 'Custom002!', ll_parent)
uo_xplistbar.of_AddLink('Display Text Shadow', 'Custom003!', ll_parent)
uo_xplistbar.of_AddLink('Hide Text Shadow', 'Custom004!', ll_parent)
uo_xplistbar.of_AddLink('Display Close Button', 'Custom029!', ll_parent)
uo_xplistbar.of_AddLink('Hide Close Button', 'Custom030!', ll_parent)
uo_xplistbar.of_AddLine(ll_parent)
uo_xplistbar.of_AddLink('Enable Calendar', 'Custom027!', ll_parent)
uo_xplistbar.of_AddLink('Disable Calendar', 'Custom028!', ll_parent)

ll_parent = uo_xplistbar.of_AddGroup('Style', '')
uo_xplistbar.of_AddLink('XP', 'Average!', ll_parent)
uo_xplistbar.of_AddLink('Vista Embossed', 'Custom005!', ll_parent)
uo_xplistbar.of_AddLink('Vista Original', 'Custom006!', ll_parent)
uo_xplistbar.of_AddLink('Vista Glass', 'Custom007!', ll_parent)
uo_xplistbar.of_AddLink('Custom', 'Custom008!', ll_parent)

ll_parent = uo_xplistbar.of_AddGroup('Theme', '')
uo_xplistbar.of_AddLink('Blue', 'Custom009!', ll_parent)
uo_xplistbar.of_AddLink('Olive', 'Custom010!', ll_parent)
uo_xplistbar.of_AddLink('Silver', 'Custom011!', ll_parent)
uo_xplistbar.of_AddLink('Windows Classic', 'Custom012!', ll_parent)
uo_xplistbar.of_AddLine(ll_parent)
uo_xplistbar.of_AddLink('Windows 2000', 'Custom013!', ll_parent)

ll_parent = uo_xplistbar.of_AddGroup('Size', 'calendar.ico')
uo_xplistbar.of_AddLink('16X16', 'Custom016!', ll_parent)
uo_xplistbar.of_AddLink('24X24', 'Custom017!', ll_parent)

ll_parent = uo_xplistbar.of_AddGroup('Pattern', '')
uo_xplistbar.of_AddLink('None', 'Custom018!', ll_parent)
uo_xplistbar.of_AddLink('Solid Circle', 'Custom019!', ll_parent)
uo_xplistbar.of_AddLink('Hollow Circle', 'Custom020!', ll_parent)
uo_xplistbar.of_AddLink('Solid Square', 'Custom021!', ll_parent)
uo_xplistbar.of_AddLink('Hollow Square', 'Custom022!', ll_parent)
uo_xplistbar.of_AddLink('Star', 'Custom023!', ll_parent)
uo_xplistbar.of_AddLink('Wave', 'Custom024!', ll_parent)
uo_xplistbar.of_AddLink('Bar', 'Custom025!', ll_parent)
uo_xplistbar.of_AddLink('Diamond', 'Custom026!', ll_parent)

ll_parent = uo_xplistbar.of_AddGroup('Header with really long title', '', uo_xplistbar.NOARROW)
uo_xplistbar.of_AddLabel('Sample label that is long and contains no carriage returns', '', ll_parent)
uo_xplistbar.of_AddLabel('Multi-line~r~nsample label', '', ll_parent)

Show()
end event

type mdi_1 from mdiclient within w_main2
long BackColor=268435456
end type

type uo_toolbarstrip from u_cst_toolbarstrip within w_main2
event destroy ( )
integer x = 5
integer y = 4
integer width = 3662
integer taborder = 20
long il_currentstyle = 2
end type

on uo_toolbarstrip.destroy
call u_cst_toolbarstrip::destroy
end on

event constructor;call super::constructor;of_DisplayRaisedBorder(TRUE)
end event

event ue_buttonclicked;call super::ue_buttonclicked;// process buttons
choose case Upper(as_button)
	case "EXIT"
		Close(Parent)
end choose

end event

event ue_mousemove;call super::ue_mousemove;Parent.SetMicroHelp("Mouse moved over " + as_button)

end event

type uo_xplistbar from u_cst_xplistbar within w_main2
integer y = 292
integer width = 873
integer height = 312
integer taborder = 40
end type

on uo_xplistbar.destroy
call u_cst_xplistbar::destroy
end on

event itemselected;call super::itemselected;u_cst_shortcutbar uo_1
u_cst_xpheader uo_2
uo_1 = iuo_3.uo_1
uo_2 = iuo_3.uo_2

uo_powerdock.of_ActivateDocument(iuo_3)

CHOOSE CASE Upper(as_group)
	CASE 'GENERAL'
		CHOOSE CASE Upper(as_item)
			CASE 'DISPLAY IMAGE IN HEADER'
				uo_1.of_DisplayHeaderImage(TRUE)
			CASE 'HIDE IMAGE IN HEADER'
				uo_1.of_DisplayHeaderImage(FALSE)
			CASE 'DISPLAY TEXT SHADOW'
				uo_1.of_SetShadowText(TRUE)
			CASE 'HIDE TEXT SHADOW'
				uo_1.of_SetShadowText(FALSE)
			CASE 'DISPLAY CLOSE BUTTON'
				uo_1.of_DisplayCloseButton(TRUE)
			CASE 'HIDE CLOSE BUTTON'
				uo_1.of_DisplayCloseButton(FALSE)
			CASE 'ENABLE CALENDAR'
				uo_1.of_SetEnabled('calendar', TRUE)
			CASE 'DISABLE CALENDAR'
				uo_1.of_SetEnabled('calendar', FALSE)
		END CHOOSE
	CASE 'STYLE'
		CHOOSE CASE Upper(as_item)
			CASE 'XP'
				uo_1.of_SetStyle(uo_1.XP)
				uo_2.of_SetStyle(uo_2.XP)
			CASE 'VISTA EMBOSSED'
				uo_1.of_SetStyle(uo_1.VISTAEMBOSSED)
				uo_2.of_SetStyle(uo_2.VISTAEMBOSSED)
				
			CASE 'VISTA ORIGINAL'
				uo_1.of_SetStyle(uo_1.VISTAORIGINAL)
				uo_2.of_SetStyle(uo_2.VISTAORIGINAL)
			CASE 'VISTA GLASS'
				uo_1.of_SetStyle(uo_1.VISTAGLASS)
				uo_2.of_SetStyle(uo_2.VISTAGLASS)
			CASE 'CUSTOM'
				uo_1.of_SetStyle(uo_1.CUSTOM)
				uo_2.of_SetStyle(uo_2.CUSTOM)
		END CHOOSE
	CASE 'THEME'
		CHOOSE CASE Upper(as_item)
			CASE 'BLUE'
				uo_1.of_SetTheme('BLUE')
				uo_2.of_SetTheme('BLUE')
			CASE 'OLIVE'
				uo_1.of_SetTheme('OLIVE')
				uo_2.of_SetTheme('OLIVE')
			CASE 'SILVER'
				uo_1.of_SetTheme('SILVER')
				uo_2.of_SetTheme('SILVER')
			CASE 'WINDOWS CLASSIC'
				uo_1.of_SetTheme('CLASSIC')
				uo_2.of_SetTheme('CLASSIC')
			CASE 'WINDOWS 2000'
				uo_1.of_SetTheme('DEFAULT')
				uo_2.of_SetTheme('DEFAULT')
			CASE 'PURPLE'
				uo_1.of_SetTheme('PURPLE')
				uo_2.of_SetTheme('PURPLE')
			CASE 'CHOCOLATE'
				uo_1.of_SetTheme('CHOCOLATE')
				uo_2.of_SetTheme('CHOCOLATE')
			CASE 'BLACK'
				uo_1.of_SetTheme('BLACK')
				uo_2.of_SetTheme('BLACK')
		END CHOOSE
	CASE 'SIZE'
		CHOOSE CASE Upper(as_item)
			CASE '16X16'
				uo_1.of_SetSize(uo_1.SMALL)
			CASE '24X24'
				uo_1.of_SetSize(uo_1.LARGE)
		END CHOOSE
	CASE 'PATTERN'
		CHOOSE CASE as_item
			CASE 'None'
				uo_1.of_SetPattern(uo_1.NOPATTERN)
			CASE 'Solid Circle'
				uo_1.of_SetPattern(uo_1.SOLIDCIRCLE)
			CASE 'Hollow Circle'
				uo_1.of_SetPattern(uo_1.HOLLOWCIRCLE)
			CASE 'Solid Square'
				uo_1.of_SetPattern(uo_1.SOLIDSQUARE)
			CASE 'Hollow Square'
				uo_1.of_SetPattern(uo_1.HOLLOWSQUARE)
			CASE 'Star'
				uo_1.of_SetPattern(uo_1.STAR)
			CASE 'Wave'
				uo_1.of_SetPattern(uo_1.WAVE)
			CASE 'Bar'
				uo_1.of_SetPattern(uo_1.BAR)
			CASE 'Diamond'				
				uo_1.of_SetPattern(uo_1.DIAMOND)
		END CHOOSE
END CHOOSE

end event

type uo_powerdock from u_cst_powerdock within w_main2
integer x = 5
integer y = 112
integer width = 585
integer height = 112
integer taborder = 20
end type

on uo_powerdock.destroy
call u_cst_powerdock::destroy
end on

event panelexpanded;call super::panelexpanded;//Parent.SetMicroHelp("Panel Expanded " + String(panel))
end event

event panelpinned;call super::panelpinned;//Parent.SetMicroHelp("Panel Pinned " + String(panel))
end event

event panelobjectdisplayed;call super::panelobjectdisplayed;//Parent.SetMicroHelp("Panel Object Displayed " + String(panelobject.classname()))
end event

event documentselectionchanged;call super::documentselectionchanged;//Parent.SetMicroHelp("Document Selection Changed " + String(document))
end event

event panelunpinned;call super::panelunpinned;//Parent.SetMicroHelp("Panel UnPinned " + String(panel))
end event

type ddlb_theme from dropdownlistbox within w_main2
integer x = 1765
integer width = 366
integer height = 364
integer taborder = 20
integer textsize = -8
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Tahoma"
long textcolor = 33554432
boolean sorted = false
boolean vscrollbar = true
string item[] = {"Blue","Silver","Olive","Classic"}
borderstyle borderstyle = stylelowered!
end type

event selectionchanged;String ls_color

ls_color = Upper(this.Text(index))

uo_PowerDock.of_SetTheme(ls_color)
uo_toolbarstrip.of_SetTheme(ls_color)
uo_xplistbar.of_SetTheme(ls_color)

IF IsValid(iuo_1) THEN
	iuo_1.of_SetTheme(ls_color)
	iuo_2.of_SetTheme(ls_color)
	iuo_3.of_SetTheme(ls_color)
	iuo_4.of_SetTheme(ls_color)
	iuo_5.of_SetTheme(ls_color)
	iuo_7.of_SetTheme(ls_color)
	iuo_6.of_SetTheme(ls_color)
END IF
end event

